# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-munkres
_pkgname=munkres
pkgver=1.1.4
pkgrel=4
pkgdesc="Munkres algorithm for the assignment problem"
url="http://software.clapper.org/munkres/"
arch="noarch"
license="Apache-2.0"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/bmc/munkres/archive/release-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-release-$pkgver"

replaces="py-munkres" # Backwards compatibility
provides="py-munkres=$pkgver-r$pkgrel" # Backwards compatibility

case "$CARCH" in
	armhf|armv7|x86)
		# test_profit_float fails on 32bit arches
		# https://github.com/bmc/munkres/issues/40
		options="$options !check"
		;;
esac

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="24ae7d04f4a6fe52f7bb9dc79bbee3e33425b85813382e2634e106a5d26d2d728ba8d34fab9390b7c3d651bc0e95214dcf9c94ac436636cd5b487a054b5a2c54  munkres-1.1.4.tar.gz"
